﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using System.Data.SqlClient;
using Adex;
using MediaMonitor.Common;


namespace MediaMonitor
{
    public partial class AdminMaster : System.Web.UI.MasterPage
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Session["UserRole"] == null || Session["Company"] == null || Session["UserID"] == null)
                Response.Redirect("../logout.aspx");
            else
            {
                if (Session["UserRole"].ToString() == "advanced user")
                {
                    aDashBoard.HRef = "javascript:void(0);";
                    aAdvertisers.HRef = "javascript:void(0);";
                    aAgencies.HRef = "javascript:void(0);";
                    aAnnouncer.HRef = "javascript:void(0);";
                    aBodies.HRef = "javascript:void(0);";
                    aBrands.HRef = "javascript:void(0);";
                    aCarrier.HRef = "javascript:void(0);";
                    aCategories.HRef = "javascript:void(0);";
                    aChangePassword.HRef = "javascript:void(0);";
                    aChangeAppPassword.HRef = "javascript:void(0)";
                    aChangeNewCommercialEmailAddress.HRef = "javascript:void(0)";
                    aColors.HRef = "javascript:void(0);";
                    aContactUs.HRef = "javascript:void(0);";
                    aCountryMngmt.HRef = "javascript:void(0);";
                    aDataManagement.HRef = "javascript:void(0);";
                    aInternet.HRef = "javascript:void(0);";
                    aMediaManagement.HRef = "javascript:void(0);";
                    aNew.HRef = "javascript:void(0);";
                    aNews.HRef = "javascript:void(0);";
                    aNewsAlert.HRef = "javascript:void(0);";
                    aNewsTemplates.HRef = "javascript:void(0);";
                    aOutdoor.HRef = "javascript:void(0);";
                    aPlanning.HRef = "javascript:void(0);";
                    aPress.HRef = "javascript:void(0);";
                    aProducts.HRef = "javascript:void(0);";
                    aPrograms.HRef = "javascript:void(0);";
                    aRFInternet.HRef = "javascript:void(0);";
                    aRFNewCommercial.HRef = "javascript:void(0);";
                    aRFNews.HRef = "javascript:void(0);";
                    aRFNewsAlert.HRef = "javascript:void(0);";
                    aRFOUTDOOR.HRef = "javascript:void(0);";
                    aRFPLANNING.HRef = "javascript:void(0);";
                    aRFPress.HRef = "javascript:void(0);";
                    aRFRadio.HRef = "javascript:void(0);";
                    aRFTRAFFIC.HRef = "javascript:void(0);";
                    aRFTV.HRef = "javascript:void(0);";
                    aRoleMngmt.HRef = "javascript:void(0);";
                    aSectors.HRef = "javascript:void(0);";
                    aTraffic.HRef = "javascript:void(0);";
                    aTV.HRef = "javascript:void(0);";
                    aTypeofBuy.HRef = "javascript:void(0);";
                    aVisibility.HRef = "javascript:void(0);";
                    aAddNewClient.HRef = "javascript:void(0);";
                    aUserManagement.HRef = "javascript:void(0);";
                    aAddNewUser.HRef = "javascript:void(0);";
                    aPeopleLink.HRef = Utility.AppPath + "/admin/PeopleLink.aspx";
                }
                else
                {
                    aDashBoard.HRef = Utility.AppPath + "/admin/default.aspx";
                    aChangePassword.HRef = Utility.AppPath + "/admin/admin-changepassword.aspx";
                    aChangeAppPassword.HRef = Utility.AppPath + "/admin/ChangeEmailPassword.aspx";
                    aChangeNewCommercialEmailAddress.HRef = Utility.AppPath + "/admin/ChangeEmailsForNewCommercial.aspx";
                    aContactUs.HRef = Utility.AppPath + "/admin/admin-contactUs.aspx";
                    aCountryMngmt.HRef = Utility.AppPath + "/admin/country-mgmt.aspx";
                    aRoleMngmt.HRef = Utility.AppPath + "/admin/ChangeRole.aspx";
                    aRFTV.HRef = Utility.AppPath + "/admin/rf-upload-puerto-rico.aspx";
                    aRFRadio.HRef = Utility.AppPath + "/admin/rf-upload2.aspx";
                    aRFPress.HRef = Utility.AppPath + "/admin/rf-upload-press.aspx";
                    aRFNews.HRef = Utility.AppPath + "/admin/rf-upload-news.aspx";
                    aRFNewCommercial.HRef = Utility.AppPath + "/admin/rf-upload-newcommercial.aspx";
                    aRFInternet.HRef = Utility.AppPath + "/admin/rf-upload-internet.aspx";
                    aRFOUTDOOR.HRef = Utility.AppPath + "/admin/rf-upload-outdoor.aspx";
                    aRFPLANNING.HRef = Utility.AppPath + "/admin/rf-upload-planning.aspx";
                    aRFTRAFFIC.HRef = Utility.AppPath + "/admin/rf-upload-traffic.aspx";
                    aRFNewsAlert.HRef = Utility.AppPath + "/admin/rf-upload-NewsAlert.aspx";
                    aDataManagement.HRef = Utility.AppPath + "/admin/data-mgmt.aspx";
                    aMediaManagement.HRef = Utility.AppPath + "/admin/data-mgmt-media.aspx";
                    aTV.HRef = Utility.AppPath + "/admin/data-mgmt-commercial2.aspx";
                    aPress.HRef = Utility.AppPath + "/admin/data-mgmt-press.aspx";
                    aNews.HRef = Utility.AppPath + "/admin/data-mgmt-news.aspx";
                    aNew.HRef = Utility.AppPath + "/admin/data-mgmt-newcommercial.aspx";
                    aInternet.HRef = Utility.AppPath + "/admin/data-mgmt-internet.aspx";
                    aOutdoor.HRef = Utility.AppPath + "/admin/data-mgmt-outdoor.aspx";
                    aPlanning.HRef = Utility.AppPath + "/admin/data-mgmt-planning.aspx";
                    aTraffic.HRef = Utility.AppPath + "/admin/data-mgmt-traffic.aspx";
                    aNewsAlert.HRef = Utility.AppPath + "/admin/data-mgmt-NewsAlert.aspx";
                    aAdvertisers.HRef = Utility.AppPath + "/admin/data-mgmt-advertiser.aspx";
                    aAgencies.HRef = Utility.AppPath + "/admin/data-mgmt-agency.aspx";
                    aBrands.HRef = Utility.AppPath + "/admin/data-mgmt-brand.aspx";
                    aCategories.HRef = Utility.AppPath + "/admin/data-mgmt-category.aspx";
                    aProducts.HRef = Utility.AppPath + "/admin/data-mgmt-product.aspx";
                    aPrograms.HRef = Utility.AppPath + "/admin/data-mgmt-program.aspx";
                    aSectors.HRef = Utility.AppPath + "/admin/data-mgmt-sector.aspx";
                    aAnnouncer.HRef = Utility.AppPath + "/admin/data-mgmt-press-announcer.aspx";
                    aTypeofBuy.HRef = Utility.AppPath + "/admin/data-mgmt-typeofbuy.aspx";
                    aBodies.HRef = Utility.AppPath + "/admin/data-mgmt-press-body.aspx";
                    aColors.HRef = Utility.AppPath + "/admin/data-mgmt-press-color.aspx";
                    aNewsTemplates.HRef = Utility.AppPath + "/admin/news-template-list.aspx";
                    aVisibility.HRef = Utility.AppPath + "/admin/data-mgmt-od-visibility.aspx";
                    aCarrier.HRef = Utility.AppPath + "/admin/data-mgmt-od-carrier.aspx";
                    aAddNewClient.HRef = Utility.AppPath + "/admin/company-mgmt-addedit.aspx";
                    aUserManagement.HRef = Utility.AppPath + "/admin/user-mgmt-list.aspx";
                    aAddNewUser.HRef = Utility.AppPath + "/admin/user-mgmt-addedit.aspx";
                    aVideoManagement.HRef = Utility.AppPath + "/admin/media-mgmt-list.aspx";
                    aPeopleLink.HRef = Utility.AppPath + "/admin/PeopleLink.aspx";
                }
            }
            if (AppUser.GetCountry() == 0)
            {
                Server.Transfer("select-country.aspx", false);
            }
        }

        protected void lnkChangeCountry_Clicked(object sender, EventArgs e)
        {
            Server.Transfer("select-country.aspx", false);
        }
    }
}